﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace AsyncSocket2.Server
{
    class Program
    {
        static void Main(string[] args)
        {
            //设置IP
            IPEndPoint IP = new IPEndPoint(IPAddress.Parse("127.0.0.1"),5001);
            //初始化Socket
            Socket socketServer = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
            //绑定IP
            socketServer.Bind(IP);
            //开始监听绑定的IP
            socketServer.Listen(8);

            socketServer.AcceptAsync(null);
        }
    }
}
